package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

final class zce {
   static ArrayList a(zn var0, zif var1, zbcp var2, com.aspose.cells.b.a.b.zp var3, float var4, double var5, int var7) throws Exception {
      int var8 = var2.af();
      byte var9 = 6;
      zbcr var10 = var1.z();
      int var11 = var10.getCount();
      zbo var12;
      zbo var13;
      int var14;
      if (var8 == 1) {
         var13 = var1.e();
         var12 = var1.E();
         var14 = var10.b(1, 6);
      } else {
         var13 = var1.g();
         var12 = var1.G();
         var14 = var10.b(2, 6);
      }

      if (var13.k() == 2) {
         return a(var0, var1, var2, var3, var4, var5);
      } else {
         double var15 = var12.n() ? zbuk.e(var12.z()) : var12.z();
         double var17 = var12.n() ? zbuk.e(var12.D()) : var12.D();
         double var19 = var12.n() ? zbuk.e(var12.x()) : var12.x();
         var5 = var12.n() ? zbuk.e(var5) : var5;
         float var21 = (float)var2.K() / 100.0F;
         float var22 = (float)var2.J() / 100.0F;
         ArrayList var23 = new ArrayList();
         boolean var24 = false;
         int var54;
         if (!var13.f() && !var1.u()) {
            var54 = var7 - 1;
            if (var54 == 0) {
               var54 = 1;
            }
         } else {
            var54 = var7;
         }

         double var25 = (double)var3.f() / (double)var54;
         float var27 = 0.0F;
         int var28 = var10.a(var2, var8, new int[]{var9});
         int var29 = var2.ai();
         zjf var30 = var2.D();

         for(int var31 = 0; var31 < var30.getCount(); ++var31) {
            zjd var32 = var30.b(var31);
            float var33 = (float)var25 / ((float)var14 - var21 * (float)(var14 - 1) + var22);
            float var34 = var33 * var21;
            float var35 = var33 * var22;
            var27 = (float)var28 * (var33 - var34);
            float var36 = (float)var25 * (float)var31 + var35 / 2.0F + var27;
            if (!var13.f() && !var1.u()) {
               var36 -= (float)(var25 / 2.0D);
            }

            if (!var13.p()) {
               var36 = (float)(var3.d() + var3.f()) - var36 - var33;
            } else {
               var36 += (float)var3.d();
            }

            if (var32 != null && !var32.a()) {
               double var37 = var32.v();
               float var39 = (float)((var5 - var37) / (var15 - var17) * (double)var3.e());
               if (var39 < 0.0F && var39 > -1.0F) {
                  if ((double)Math.abs(var39) < 0.1D && var19 / Math.abs(var37) > 1.0E8D) {
                     var39 = 0.0F;
                  } else {
                     var39 = -1.0F;
                  }
               }

               if (var39 > 0.0F && var39 < 1.0F) {
                  if ((double)Math.abs(var39) < 0.1D && var19 / Math.abs(var37) > 1.0E7D) {
                     var39 = 0.0F;
                  } else {
                     var39 = 1.0F;
                  }
               }

               boolean var40 = false;
               if (var39 == 0.0F) {
                  var40 = true;
               }

               zsp var41 = var2.x();
               com.aspose.cells.b.a.b.zo var42 = new com.aspose.cells.b.a.b.zo(var4, var36 + var33 / 2.0F);
               double var43 = 0.0D;
               double var45 = 0.0D;
               float var47 = 0.0F;
               float var48 = 0.0F;
               if (var41 != null) {
                  switch(var41.g()) {
                  case 0:
                     double var49 = var41.e().size() > var31 ? var41.a(var41.e().get(var31)) : 0.0D;
                     var43 = var49;
                     var49 = var41.f().size() > var31 ? var41.a(var41.f().get(var31)) : 0.0D;
                     var45 = var49;
                     break;
                  case 1:
                     var43 = var41.c();
                     var45 = var43;
                     break;
                  case 2:
                     var43 = var41.c() * var37 / 100.0D;
                     var45 = -var43;
                  }

                  var47 = (float)var43 / (float)(var15 - var17) * (float)var3.e();
                  var48 = (float)var45 / (float)(var15 - var17) * (float)var3.e();
                  if (!var12.p()) {
                     var42.a(var42.d() - var39);
                  } else {
                     var42.a(var42.d() + var39);
                  }
               }

               var41.a(var42, var47, var48);
               float var55 = var4;
               if (var12.p()) {
                  if (var39 < 0.0F) {
                     var39 = -var39;
                     var55 = var4 - var39;
                  }
               } else if (var39 < 0.0F) {
                  var39 = -var39;
               } else {
                  var55 = var4 - var39;
               }

               com.aspose.cells.b.a.b.zq var50 = new com.aspose.cells.b.a.b.zq(var55, var36, var39, var33);
               com.aspose.cells.b.a.b.zq var51 = new com.aspose.cells.b.a.b.zq(var50.f(), var50.g(), var50.h(), var50.i());
               if (var50.f() < (float)var3.c()) {
                  var50.c(var50.h() - ((float)var3.c() - var50.f()));
                  var50.a((float)var3.c());
               }

               if (var50.l() > (float)(var3.i() + 1)) {
                  var50.c(var50.h() - (var50.l() - (float)var3.i()));
               }

               if (var50.m() >= (float)var3.d() && var50.g() <= (float)var3.j()) {
                  if (var50.g() < (float)var3.d()) {
                     var50.d(var50.i() - ((float)var3.d() - var50.g()));
                     var50.b((float)var3.d());
                  } else if (var50.m() > (float)var3.j()) {
                     var50.d(var50.i() - (var50.m() - (float)var3.j()));
                  }

                  if (var50.i() + 1.0F >= (var33 - 1.0F) / 3.0F) {
                     if (!var40) {
                        a(var0, var32, var50, var1.g(var2.aw()).a(var29), var4, var12);
                     }

                     Object[] var52 = new Object[4];
                     boolean var53;
                     if (var51.f() < var4) {
                        var53 = false;
                     } else if (var37 != 0.0D) {
                        var53 = true;
                     } else if (var12.p()) {
                        var53 = false;
                     } else {
                        var53 = true;
                     }

                     var52[0] = var29;
                     var52[1] = var31;
                     var52[2] = var51;
                     var52[3] = var53;
                     com.aspose.cells.b.a.a.ze.a(var23, (Object)var52);
                  }
               }
            }
         }

         return var23;
      }
   }

   private static void a(zn var0, zjd var1, com.aspose.cells.b.a.b.zq var2, Color var3, float var4, zbo var5) {
      if (var1.i().h() != 0 || var1.k().e()) {
         var1.a(new com.aspose.cells.b.a.b.zq(var2.f(), var2.g(), var2.h(), var2.i()));
      }

      if (var2.i() < 10.0F) {
         var2.b((float)((int)var2.g()));
      }

      boolean var6 = var1.g().a().A().a();
      if (!var1.i().a) {
         var6 = var1.i().a();
      }

      boolean var7 = false;
      if (var2.f() + 2.0F < var4 && var6 && !var5.p() || var2.l() - 2.0F > var4 && var6 && var5.p()) {
         var7 = true;
      }

      if (var1.i().h() != 0) {
         com.aspose.cells.b.a.b.zc var8 = zax.a(var1.i(), var2, var7);

         try {
            var0.b(var8, var2);
         } finally {
            if (var8 != null) {
               var8.f();
            }

         }
      }

      if (var1.k().b().a() > 2.0D) {
         if ((double)var2.h() > var1.k().b().a() / 2.0D) {
            var2.c(var2.h() - (float)var1.k().b().a() / 2.0F);
         }

         if ((double)var2.i() > var1.k().b().a() / 2.0D) {
            var2.d(var2.i() - (float)var1.k().b().a() / 2.0F);
         }
      }

      zama.a(var0, var2, var1.k());
      boolean var20 = false;
      if (var2.l() - 2.0F < var4) {
         var20 = true;
      }

      if (var1.F() && (var1.i().h() != 0 || var1.k().c() != 0)) {
         com.aspose.cells.b.a.b.zm var9 = new com.aspose.cells.b.a.b.zm(Color.getBlack(), 2.0F);

         try {
            byte var10 = 2;
            byte var11 = 1;
            com.aspose.cells.b.a.b.a.ze var12 = new com.aspose.cells.b.a.b.a.ze();
            var12.b(var2.f() + (float)var10, var2.m() + (float)var11, var2.l() + (float)var11, var2.m() + (float)var11);
            if (!var20) {
               var12.b(var2.l() + (float)var11, var2.m() + (float)var11, var2.l() + (float)var11, var2.g() + (float)var10);
            }

            var0.a(var9, var12);
         } finally {
            if (var9 != null) {
               var9.r();
            }

         }
      }

   }

   static void a(zn var0, zif var1, com.aspose.cells.b.a.b.zp var2, ArrayList var3) throws Exception {
      if (!zbuk.a(var2)) {
         zbcr var4 = var1.z();

         for(int var5 = 0; var5 < var3.size(); ++var5) {
            Object[] var6 = (Object[])((Object[])var3.get(var5));
            int var7 = (Integer)var6[0];
            int var8 = (Integer)var6[1];
            com.aspose.cells.b.a.b.zq var9 = (com.aspose.cells.b.a.b.zq)var6[2];
            boolean var10 = (Boolean)var6[3];
            zbcp var11 = var4.c(var7);
            int var12 = var11.af();
            zbo var13;
            if (var12 == 1) {
               var13 = var1.e();
            } else {
               var13 = var1.g();
            }

            a(var0, var13, var4, var7, var8, var9, var10, var2.e());
         }

      }
   }

   private static void a(zn var0, zbo var1, zbcr var2, int var3, int var4, com.aspose.cells.b.a.b.zq var5, boolean var6, int var7) throws Exception {
      zjd var8 = var2.c(var3).D().b(var4);
      zpt var9 = var8.o();
      com.aspose.cells.b.a.b.zt var10 = zpv.a(var0, var1, var2, var3, var4, var7);
      float var11 = 0.0F;
      float var12 = var5.g() + (var5.i() - var10.c()) / 2.0F;
      boolean var13 = false;
      boolean var14 = false;
      int var15 = var9.j();
      if (var15 == 9) {
         var15 = zpv.b(var2.a(var3).m());
      }

      boolean var16 = false;
      byte var19;
      byte var20;
      switch(var15) {
      case 1:
         var11 = var5.f() + var5.h() / 2.0F - var10.b() / 2.0F;
         break;
      case 2:
         if (var6) {
            var11 = var5.f();
            var20 = 5;
            var11 += (float)var20;
         } else {
            var11 = var5.f() + var5.h() - var10.b();
         }
         break;
      case 3:
         if (var6) {
            var11 = var5.f() + var5.h() - var10.b();
            var19 = -1;
            var11 += (float)var19;
         } else {
            var11 = var5.f();
            byte var21 = 6;
            var11 += (float)var21;
         }
         break;
      default:
         if (var8.v() <= var1.ab().z() && var8.v() > var1.ab().D()) {
            var16 = true;
         }

         if (var6) {
            var11 = var5.f() + var5.h();
            var20 = 5;
            var11 += (float)var20;
         } else {
            var11 = var5.f() - var10.b();
            var19 = -5;
            var11 += (float)var19;
         }
      }

      if (var2.c(var3).a(new int[]{6})) {
         if (var6) {
            if (var11 - (float)zpv.a < var5.f()) {
               var11 += var5.f() - (var11 - (float)zpv.a);
            }
         } else {
            if (var11 + (float)zpv.a + var10.b() > var5.l()) {
               var11 -= var11 + (float)zpv.a + var10.b() - var5.l();
            }

            if (var9.j() == 9 && var5.h() <= 3.0F) {
               var11 = var5.l();
            }
         }
      }

      var9.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var11), zbuk.c((double)var12), zbuk.a((double)var10.b()), zbuk.a((double)var10.c()));
      var9.a().z();
      boolean var17 = false;
      com.aspose.cells.b.a.b.zo var18 = new com.aspose.cells.b.a.b.zo((float)(var9.a().a.c() + var9.a().a.e()), (float)(var9.a().a.d() + var9.a().a.f()));
      if (!var16 && (var18.d() < 0.0F || var18.d() > (float)var1.c().a() || var18.e() < 0.0F || var18.e() > (float)var1.c().b())) {
         var17 = true;
      }

      if (!var17) {
         zpv.a(var0, var1, var2, var3, var4, var9.a().a);
      }

   }

   private static ArrayList a(zn var0, zif var1, zbcp var2, com.aspose.cells.b.a.b.zp var3, float var4, double var5) throws Exception {
      int var7 = var2.af();
      byte var8 = 6;
      int var9 = var1.z().getCount();
      zbcr var10 = var1.z();
      zbo var11;
      int var12;
      zbo var13;
      ArrayList var14;
      if (var7 == 1) {
         var13 = var1.e();
         var11 = var1.E();
         var12 = var10.b(1, 6);
         var14 = zhz.a((List)var1.z().c(), var1.S());
      } else {
         var13 = var1.g();
         var11 = var1.G();
         var12 = var10.b(2, 6);
         var14 = zhz.a((List)var1.z().d(), var1.S());
      }

      double var15 = var11.n() ? zbuk.e(var11.z()) : var11.z();
      double var17 = var11.n() ? zbuk.e(var11.D()) : var11.D();
      double var19 = var11.n() ? zbuk.e(var11.x()) : var11.x();
      var5 = var11.n() ? zbuk.e(var5) : var5;
      float var21 = (float)var2.K() / 100.0F;
      float var22 = (float)var2.J() / 100.0F;
      ArrayList var23 = new ArrayList();
      int var24 = var14.size();
      int var25 = var13.j();
      int var26 = (int)var13.D();
      int var27 = (int)var13.z();
      boolean var28 = false;
      int var59;
      if (!var13.f() && !var1.u()) {
         var59 = zbq.a(var25, var27, var26, var1.S());
         if (var59 == 0) {
            var59 = 1;
         }
      } else {
         var59 = zbq.a(var25, var27, var26, var1.S()) + 1;
      }

      double var29 = (double)var3.f() / (double)var59;

      for(int var31 = 0; var31 < var24; ++var31) {
         zjd var32 = var2.D().b(var31);
         float var33 = (float)(var29 / (double)((float)var12 - var21 * (float)(var12 - 1) + var22));
         float var34 = var33 * var21;
         float var35 = var33 * var22;
         int var36 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var14.get(var31)));
         var36 = zbq.a(var25, var36, var1.S());
         int var37 = zbq.a(var25, var36, var26, var1.S());
         float var38 = (float)(var29 * (double)var37);
         if (!var13.f() && !var1.u()) {
            var38 -= (float)(var29 / 2.0D);
         }

         float var39 = 0.0F;
         if (var13.p()) {
            var39 = (float)var3.d() + var38 + var35 / 2.0F;
         } else {
            var39 = (float)(var3.d() + var3.f()) - var33 - var38 - var35 / 2.0F;
         }

         int var40 = var10.a(var2, var7, new int[]{var8});
         int var41 = var2.ai();
         if (var13.p()) {
            var39 += (float)var40 * (var33 - var34);
         } else {
            var39 -= (float)var40 * (var33 - var34);
         }

         if (var32 != null && !var32.a()) {
            double var42 = var32.v();
            float var44 = (float)((var5 - var42) / (var15 - var17) * (double)var3.e());
            if (var44 < 0.0F && var44 > -1.0F) {
               if ((double)Math.abs(var44) < 0.1D && var19 / Math.abs(var42) > 1.0E8D) {
                  var44 = 0.0F;
               } else {
                  var44 = -1.0F;
               }
            }

            if (var44 > 0.0F && var44 < 1.0F) {
               if ((double)Math.abs(var44) < 0.1D && var19 / Math.abs(var42) > 1.0E7D) {
                  var44 = 0.0F;
               } else {
                  var44 = 1.0F;
               }
            }

            boolean var45 = false;
            if (var44 == 0.0F) {
               var45 = true;
            }

            float var46 = var4;
            zsp var47 = var2.x();
            com.aspose.cells.b.a.b.zo var48 = new com.aspose.cells.b.a.b.zo(var4, var39 + var33 / 2.0F);
            double var49 = 0.0D;
            double var51 = 0.0D;
            float var53 = 0.0F;
            float var54 = 0.0F;
            if (var47 != null) {
               switch(var47.g()) {
               case 0:
                  double var55 = var47.e().size() > var31 ? var47.a(var47.e().get(var31)) : 0.0D;
                  var49 = var55;
                  var55 = var47.f().size() > var31 ? var47.a(var47.f().get(var31)) : 0.0D;
                  var51 = var55;
                  break;
               case 1:
                  var49 = var47.c();
                  var51 = var49;
                  break;
               case 2:
                  var49 = var47.c() * var42 / 100.0D;
                  var51 = -var49;
               }

               var53 = (float)var49 / (float)(var15 - var17) * (float)var3.e();
               var54 = (float)var51 / (float)(var15 - var17) * (float)var3.e();
               if (!var11.p()) {
                  var48.a(var48.d() - var44);
               } else {
                  var48.a(var48.d() + var44);
               }
            }

            var47.a(var48, var53, var54);
            if (!var11.p()) {
               if (var44 < 0.0F) {
                  var44 = -var44;
               } else {
                  var46 = var4 - var44;
               }
            } else if (var44 < 0.0F) {
               var44 = -var44;
               var46 = var4 - var44;
            }

            com.aspose.cells.b.a.b.zq var60 = new com.aspose.cells.b.a.b.zq(var46, var39, var44, var33);
            com.aspose.cells.b.a.b.zq var56 = new com.aspose.cells.b.a.b.zq(var60.f(), var60.g(), var60.h(), var60.i());
            if (var60.g() < (float)var3.d()) {
               var60.d(var60.i() - ((float)var3.d() - var60.g()));
               var60.b((float)var3.d());
            }

            if (var60.m() > (float)(var3.j() + 1)) {
               var60.d(var60.i() - (var60.m() - (float)var3.j()));
            }

            if (var60.l() >= (float)var3.c() && var60.j() <= (float)var3.i()) {
               if (var60.f() < (float)var3.c()) {
                  var60.c(var60.h() - ((float)var3.c() - var60.f()));
                  var60.a((float)var3.c());
               } else if (var60.l() > (float)var3.i()) {
                  var60.c(var60.h() - (var60.l() - (float)var3.i()));
               }

               if (var60.i() + 1.0F >= (var33 - 1.0F) / 3.0F) {
                  if (!var45) {
                     a(var0, var32, var60, var1.g(var2.aw()).a(var41), var4, var11);
                  }

                  Object[] var57 = new Object[4];
                  boolean var58;
                  if (var56.f() < var4) {
                     var58 = false;
                  } else if (var42 != 0.0D) {
                     var58 = true;
                  } else if (var11.p()) {
                     var58 = false;
                  } else {
                     var58 = true;
                  }

                  var57[0] = var41;
                  var57[1] = var31;
                  var57[2] = var56;
                  var57[3] = var58;
                  com.aspose.cells.b.a.a.ze.a(var23, (Object)var57);
               }
            }
         }
      }

      return var23;
   }

   static ArrayList a(zn var0, zif var1, zbcp var2, com.aspose.cells.b.a.b.zp var3, int var4) throws Exception {
      int var5 = var2.af();
      byte var6 = 7;
      zbcr var7 = var1.z();
      int var8 = var7.getCount();
      zbo var9;
      zbo var10;
      int var11;
      if (var5 == 1) {
         var10 = var1.e();
         var9 = var1.E();
         var11 = var7.b(1, var6);
      } else {
         var10 = var1.g();
         var9 = var1.G();
         var11 = var7.b(2, var6);
      }

      float var12 = 0.0F;
      if (var9.p()) {
         var12 = (float)var3.c() + (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var3.e();
      } else {
         var12 = (float)var3.i() - (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var3.e();
      }

      if (var10.k() == 2) {
         return a(var0, var1, var2, var3, var12);
      } else {
         double var13 = var9.D();
         double var15 = var9.z();
         float var17 = (float)var2.K() / 100.0F;
         float var18 = (float)var2.J() / 100.0F;
         ArrayList var19 = new ArrayList();
         boolean var20 = false;
         int var55;
         if (!var10.f() && !var1.u()) {
            var55 = var4 - 1;
            if (var55 == 0) {
               var55 = 1;
            }
         } else {
            var55 = var4;
         }

         double var21 = (double)var3.f() / (double)var55;
         float var23 = 0.0F;
         List var24 = var7.a(var5, new int[]{var6});
         int var25 = var7.a(var2, var5, new int[]{var6});
         if (var25 == -1) {
            return var19;
         } else {
            int var26 = var2.ai();
            zjf var27 = var2.D();
            ArrayList var28 = new ArrayList();

            for(int var29 = 0; var29 < var27.getCount(); ++var29) {
               zjd var30 = var27.b(var29);
               float var31 = (float)var21 / ((float)var11 - var17 * (float)(var11 - 1) + var18);
               float var32 = var31 * var17;
               float var33 = var31 * var18;
               var23 = (float)var25 * (var31 - var32);
               float var34 = (float)var21 * (float)var29 + var33 / 2.0F + var23;
               if (!var10.f() && !var1.u()) {
                  var34 -= (float)(var21 / 2.0D);
               }

               if (!var10.p()) {
                  var34 = (float)(var3.d() + var3.f()) - var34 - var31;
               } else {
                  var34 += (float)var3.d();
               }

               ArrayList var35 = new ArrayList();
               if (var30 != null) {
                  double var36 = var30.v();
                  double var38 = var36;
                  int var40;
                  zjd var41;
                  double var42;
                  if (var36 >= 0.0D) {
                     for(var40 = 0; var40 < var25; ++var40) {
                        var41 = ((zbcp)var24.get(var40)).D().b(var29);
                        if (var41 != null) {
                           var42 = var41.v();
                           if (var42 > 0.0D) {
                              var38 += var42;
                           }
                        }
                     }
                  } else {
                     for(var40 = 0; var40 < var25; ++var40) {
                        var41 = ((zbcp)var24.get(var40)).D().b(var29);
                        if (var41 != null) {
                           var42 = var41.v();
                           if (var42 <= 0.0D) {
                              var38 += var42;
                           }
                        }
                     }
                  }

                  float var57 = (float)(Math.abs(var36) / (var9.z() - var9.D()) * (double)var3.e());
                  float var58 = (float)(Math.abs(var38) / (var9.z() - var9.D()) * (double)var3.e());
                  boolean var59 = false;
                  if (var57 == 0.0F) {
                     var59 = true;
                  }

                  zsp var43 = var2.x();
                  com.aspose.cells.b.a.b.zo var44 = new com.aspose.cells.b.a.b.zo(var12, var34 + var31 / 2.0F);
                  double var45 = 0.0D;
                  double var47 = 0.0D;
                  float var49 = 0.0F;
                  float var50 = 0.0F;
                  if (var43 != null) {
                     switch(var43.g()) {
                     case 0:
                        double var51 = var43.e().size() > var29 ? var43.a(var43.e().get(var29)) : 0.0D;
                        var45 = var51;
                        var51 = var43.f().size() > var29 ? var43.a(var43.f().get(var29)) : 0.0D;
                        var47 = var51;
                        break;
                     case 1:
                        var45 = var43.c();
                        var47 = var45;
                        break;
                     case 2:
                        var45 = var43.c() * var36 / 100.0D;
                        var47 = -var45;
                     }

                     var49 = (float)var45 / (float)(var9.z() - var9.D()) * (float)var3.e();
                     var50 = (float)var47 / (float)(var9.z() - var9.D()) * (float)var3.e();
                     if (!var9.p()) {
                        if (var36 <= 0.0D) {
                           var44.a(var44.d() - var58);
                        } else {
                           var44.a(var44.d() + var58);
                        }
                     } else if (var36 <= 0.0D) {
                        var44.a(var44.d() + var58);
                     } else {
                        var44.a(var44.d() - var58);
                     }
                  }

                  var43.a(var44, var49, var50);
                  if (!var9.p()) {
                     if (var36 >= 0.0D) {
                        var58 = var12 + var58 - var57;
                     } else {
                        var58 = var12 - var58;
                     }
                  } else if (var36 >= 0.0D) {
                     var58 = var12 - var58;
                  } else {
                     var58 = var12 + var58 - var57;
                  }

                  com.aspose.cells.b.a.b.zq var60 = new com.aspose.cells.b.a.b.zq(var58, var34, var57, var31);
                  com.aspose.cells.b.a.b.zq var52 = new com.aspose.cells.b.a.b.zq(var60.f(), var60.g(), var60.h(), var60.i());
                  if (var60.f() < (float)var3.c()) {
                     var60.c(var60.h() - ((float)var3.c() - var60.f()));
                     var60.a((float)var3.c());
                  }

                  if (var60.l() > (float)(var3.i() + 1)) {
                     var60.c(var60.h() - (var60.l() - (float)var3.i()));
                  }

                  if (var60.m() >= (float)var3.d() && var60.g() <= (float)var3.j()) {
                     if (var60.g() < (float)var3.d()) {
                        var60.d(var60.i() - ((float)var3.d() - var60.g()));
                        var60.b((float)var3.d());
                     } else if (var60.m() > (float)var3.j()) {
                        var60.d(var60.i() - (var60.m() - (float)var3.j()));
                     }

                     if (var60.i() + 1.0F >= (var31 - 1.0F) / 3.0F) {
                        if (!var59) {
                           a(var0, var30, var60, var1.g(var2.aw()).a(var26), var12, var9);
                        }

                        Object[] var53 = new Object[4];
                        boolean var54;
                        if (var52.f() + var52.h() / 2.0F < var12) {
                           var54 = false;
                        } else if (var36 != 0.0D) {
                           var54 = true;
                        } else if (var9.p()) {
                           var54 = false;
                        } else {
                           var54 = true;
                        }

                        var53[0] = var26;
                        var53[1] = var29;
                        var53[2] = var52;
                        var53[3] = var54;
                        if (!var30.a()) {
                           com.aspose.cells.b.a.a.ze.a(var19, (Object)var53);
                        }

                        if (var2.X()) {
                           com.aspose.cells.b.a.a.ze.a(var35, (Object)var60);
                           com.aspose.cells.b.a.a.ze.a(var35, (Object)var54);
                        }
                     }
                  }
               }

               ArrayList[] var56 = new ArrayList[]{var28};
               a(var0, var2, var56, var35);
               var28 = var56[0];
            }

            return var19;
         }
      }
   }

   private static void a(zn var0, zbcp var1, ArrayList[] var2, ArrayList var3) {
      if (var2[0].size() > 0 && var3.size() > 0 && var1.X()) {
         com.aspose.cells.b.a.b.zq var4 = (com.aspose.cells.b.a.b.zq)var2[0].get(0);
         boolean var5 = (Boolean)var2[0].get(1);
         com.aspose.cells.b.a.b.zq var6 = (com.aspose.cells.b.a.b.zq)var3.get(0);
         boolean var7 = (Boolean)var3.get(1);
         com.aspose.cells.b.a.b.zo var8;
         com.aspose.cells.b.a.b.zo var9;
         if (var4.g() < var6.g()) {
            if (var5) {
               var8 = new com.aspose.cells.b.a.b.zo(var4.l(), var4.m());
            } else {
               var8 = new com.aspose.cells.b.a.b.zo(var4.j(), var4.m());
            }

            if (var7) {
               var9 = new com.aspose.cells.b.a.b.zo(var6.l(), var6.k());
            } else {
               var9 = new com.aspose.cells.b.a.b.zo(var6.j(), var6.k());
            }
         } else {
            if (var5) {
               var8 = new com.aspose.cells.b.a.b.zo(var4.l(), var4.k());
            } else {
               var8 = new com.aspose.cells.b.a.b.zo(var4.j(), var4.k());
            }

            if (var7) {
               var9 = new com.aspose.cells.b.a.b.zo(var6.l(), var6.m());
            } else {
               var9 = new com.aspose.cells.b.a.b.zo(var6.j(), var6.m());
            }
         }

         zama.a(var0, var8, var9, var1.Y());
      }

      if (var3.size() > 0) {
         var2[0] = var3;
      }

   }

   private static ArrayList a(zn var0, zif var1, zbcp var2, com.aspose.cells.b.a.b.zp var3, float var4) throws Exception {
      int var5 = var2.af();
      byte var6 = 7;
      zbcr var7 = var1.z();
      int var8 = var7.getCount();
      zbo var9;
      int var10;
      zbo var11;
      ArrayList var12;
      if (var5 == 1) {
         var11 = var1.e();
         var9 = var1.E();
         var10 = var7.b(1, var6);
         var12 = zhz.a((List)var1.z().c(), var1.S());
      } else {
         var11 = var1.g();
         var9 = var1.G();
         var10 = var7.b(2, var6);
         var12 = zhz.a((List)var1.z().d(), var1.S());
      }

      double var13 = var9.D();
      double var15 = var9.z();
      float var17 = (float)var2.K() / 100.0F;
      float var18 = (float)var2.J() / 100.0F;
      ArrayList var19 = new ArrayList();
      int var20 = var12.size();
      int var21 = var11.j();
      int var22 = (int)var11.D();
      int var23 = (int)var11.z();
      boolean var24 = false;
      int var60;
      if (!var11.f() && !var1.u()) {
         var60 = zbq.a(var21, var23, var22, var1.S());
         if (var60 == 0) {
            var60 = 1;
         }
      } else {
         var60 = zbq.a(var21, var23, var22, var1.S()) + 1;
      }

      double var25 = (double)var3.f() / (double)var60;
      ArrayList var27 = new ArrayList();

      for(int var28 = 0; var28 < var20; ++var28) {
         zjd var29 = var2.D().b(var28);
         float var30 = (float)(var25 / (double)((float)var10 - var17 * (float)(var10 - 1) + var18));
         float var31 = var30 * var17;
         float var32 = var30 * var18;
         int var33 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var12.get(var28)));
         var33 = zbq.a(var21, var33, var1.S());
         int var34 = zbq.a(var21, var33, var22, var1.S());
         float var35 = (float)(var25 * (double)var34);
         if (!var11.f() && !var1.u()) {
            var35 -= (float)(var25 / 2.0D);
         }

         float var36 = 0.0F;
         if (var11.p()) {
            var36 = (float)var3.d() + var35 + var32 / 2.0F;
         } else {
            var36 = (float)(var3.d() + var3.f()) - var30 - var35 - var32 / 2.0F;
         }

         List var37 = var7.a(var5, new int[]{var6});
         int var38 = var7.a(var2, var5, new int[]{var6});
         if (var38 == -1) {
            return var19;
         }

         int var39 = var2.ai();
         if (var11.p()) {
            var36 += (float)var38 * (var30 - var31);
         } else {
            var36 -= (float)var38 * (var30 - var31);
         }

         ArrayList var40 = new ArrayList();
         if (var29 != null) {
            double var41 = var29.v();
            double var43 = var41;
            int var45;
            zjd var46;
            double var47;
            if (var41 >= 0.0D) {
               for(var45 = 0; var45 < var38; ++var45) {
                  var46 = ((zbcp)var37.get(var45)).D().b(var28);
                  if (var46 != null) {
                     var47 = var46.v();
                     if (var47 > 0.0D) {
                        var43 += var47;
                     }
                  }
               }
            } else {
               for(var45 = 0; var45 < var38; ++var45) {
                  var46 = ((zbcp)var37.get(var45)).D().b(var28);
                  if (var46 != null) {
                     var47 = var46.v();
                     if (var47 <= 0.0D) {
                        var43 += var47;
                     }
                  }
               }
            }

            float var62 = (float)(Math.abs(var41) / (var9.z() - var9.D()) * (double)var3.e());
            float var63 = (float)(Math.abs(var43) / (var9.z() - var9.D()) * (double)var3.e());
            boolean var64 = false;
            if (var62 == 0.0F) {
               var64 = true;
            }

            zsp var48 = var2.x();
            com.aspose.cells.b.a.b.zo var49 = new com.aspose.cells.b.a.b.zo(var4, var36 + var30 / 2.0F);
            double var50 = 0.0D;
            double var52 = 0.0D;
            float var54 = 0.0F;
            float var55 = 0.0F;
            if (var48 != null) {
               switch(var48.g()) {
               case 0:
                  double var56 = var48.e().size() > var28 ? var48.a(var48.e().get(var28)) : 0.0D;
                  var50 = var56;
                  var56 = var48.f().size() > var28 ? var48.a(var48.f().get(var28)) : 0.0D;
                  var52 = var56;
                  break;
               case 1:
                  var50 = var48.c();
                  var52 = var50;
                  break;
               case 2:
                  var50 = var48.c() * var41 / 100.0D;
                  var52 = -var50;
               }

               var54 = (float)var50 / (float)(var9.z() - var9.D()) * (float)var3.e();
               var55 = (float)var52 / (float)(var9.z() - var9.D()) * (float)var3.e();
               if (!var9.p()) {
                  if (var41 <= 0.0D) {
                     var49.a(var49.d() - var63);
                  } else {
                     var49.a(var49.d() + var63);
                  }
               } else if (var41 <= 0.0D) {
                  var49.a(var49.d() + var63);
               } else {
                  var49.a(var49.d() - var63);
               }
            }

            var48.a(var49, var54, var55);
            if (!var9.p()) {
               if (var41 >= 0.0D) {
                  var63 = var4 + var63 - var62;
               } else {
                  var63 = var4 - var63;
               }
            } else if (var41 >= 0.0D) {
               var63 = var4 - var63;
            } else {
               var63 = var4 + var63 - var62;
            }

            com.aspose.cells.b.a.b.zq var65 = new com.aspose.cells.b.a.b.zq(var63, var36, var62, var30);
            com.aspose.cells.b.a.b.zq var57 = new com.aspose.cells.b.a.b.zq(var65.f(), var65.g(), var65.h(), var65.i());
            if (var65.g() < (float)var3.d()) {
               var65.d(var65.i() - ((float)var3.d() - var65.g()));
               var65.b((float)var3.d());
            }

            if (var65.m() > (float)(var3.j() + 1)) {
               var65.d(var65.i() - (var65.m() - (float)var3.j()));
            }

            if (var65.l() >= (float)var3.c() && var65.j() <= (float)var3.i()) {
               if (var65.f() < (float)var3.c()) {
                  var65.c(var65.h() - ((float)var3.c() - var65.f()));
                  var65.a((float)var3.c());
               } else if (var65.l() > (float)var3.i()) {
                  var65.c(var65.h() - (var65.l() - (float)var3.i()));
               }

               if (var65.i() + 1.0F >= (var30 - 1.0F) / 3.0F) {
                  if (!var64) {
                     a(var0, var29, var65, var1.g(var2.aw()).a(var39), var4, var9);
                  }

                  Object[] var58 = new Object[4];
                  boolean var59;
                  if (var57.f() + var57.h() / 2.0F < var4) {
                     var59 = false;
                  } else if (var41 != 0.0D) {
                     var59 = true;
                  } else if (var9.p()) {
                     var59 = false;
                  } else {
                     var59 = true;
                  }

                  var58[0] = var39;
                  var58[1] = var28;
                  var58[2] = var57;
                  var58[3] = var59;
                  if (!var29.a()) {
                     com.aspose.cells.b.a.a.ze.a(var19, (Object)var58);
                  }

                  if (var2.X()) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var65);
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var59);
                  }
               }
            }
         }

         ArrayList[] var61 = new ArrayList[]{var27};
         a(var0, var2, var61, var40);
         var27 = var61[0];
      }

      return var19;
   }

   static ArrayList b(zn var0, zif var1, zbcp var2, com.aspose.cells.b.a.b.zp var3, int var4) throws Exception {
      int var5 = var2.af();
      byte var6 = 8;
      zbcr var7 = var1.z();
      int var8 = var7.getCount();
      zbo var9;
      zbo var10;
      int var11;
      if (var5 == 1) {
         var10 = var1.e();
         var9 = var1.E();
         var11 = var7.b(1, var6);
      } else {
         var10 = var1.g();
         var9 = var1.G();
         var11 = var7.b(2, var6);
      }

      float var12 = 0.0F;
      if (var9.p()) {
         var12 = (float)var3.c() + (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var3.e();
      } else {
         var12 = (float)var3.i() - (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var3.e();
      }

      if (var10.k() == 2) {
         return b(var0, var1, var2, var3, var12);
      } else {
         double var13 = var9.D();
         double var15 = var9.z();
         float var17 = (float)var2.K() / 100.0F;
         float var18 = (float)var2.J() / 100.0F;
         ArrayList var19 = new ArrayList();
         boolean var20 = false;
         int var57;
         if (!var10.f() && !var1.u()) {
            var57 = var4 - 1;
            if (var57 == 0) {
               var57 = 1;
            }
         } else {
            var57 = var4;
         }

         double var21 = (double)var3.f() / (double)var57;
         float var23 = 0.0F;
         List var24 = var7.a(var5, new int[]{var6});
         int var25 = var7.a(var2, var5, new int[]{var6});
         if (var25 == -1) {
            return var19;
         } else {
            int var26 = var2.ai();
            ArrayList var27 = new ArrayList();
            zjf var28 = var2.D();

            for(int var29 = 0; var29 < var28.getCount(); ++var29) {
               zjd var30 = var28.b(var29);
               float var31 = (float)var21 / ((float)var11 - var17 * (float)(var11 - 1) + var18);
               float var32 = var31 * var17;
               float var33 = var31 * var18;
               var23 = (float)var25 * (var31 - var32);
               float var34 = (float)var21 * (float)var29 + var33 / 2.0F + var23;
               if (!var10.f() && !var1.u()) {
                  var34 -= (float)(var21 / 2.0D);
               }

               if (!var10.p()) {
                  var34 = (float)(var3.d() + var3.f()) - var34 - var31;
               } else {
                  var34 += (float)var3.d();
               }

               ArrayList var35 = new ArrayList();
               if (var30 != null) {
                  double var36 = var30.v();
                  double var38 = var36;
                  double var40 = 0.0D;
                  int var42;
                  zjd var43;
                  double var44;
                  if (var36 >= 0.0D) {
                     for(var42 = 0; var42 < var25; ++var42) {
                        var43 = ((zbcp)var24.get(var42)).D().b(var29);
                        if (var43 != null) {
                           var44 = var43.v();
                           if (var44 > 0.0D) {
                              var38 += var44;
                           }
                        }
                     }
                  } else {
                     for(var42 = 0; var42 < var25; ++var42) {
                        var43 = ((zbcp)var24.get(var42)).D().b(var29);
                        if (var43 != null) {
                           var44 = var43.v();
                           if (var44 <= 0.0D) {
                              var38 += var44;
                           }
                        }
                     }
                  }

                  for(var42 = 0; var42 < var24.size(); ++var42) {
                     var43 = ((zbcp)var24.get(var42)).D().b(var29);
                     if (var43 != null) {
                        var44 = var43.v();
                        var40 += Math.abs(var44);
                     }
                  }

                  float var59 = 0.0F;
                  float var60 = 0.0F;
                  if (var40 != 0.0D) {
                     var59 = (float)(Math.abs(var36) * 100.0D / var40 / (var9.z() - var9.D()) * (double)var3.e());
                     var60 = (float)(Math.abs(var38) * 100.0D / var40 / (var9.z() - var9.D()) * (double)var3.e());
                  }

                  boolean var61 = false;
                  if (var59 == 0.0F) {
                     var61 = true;
                  }

                  zsp var45 = var2.x();
                  com.aspose.cells.b.a.b.zo var46 = new com.aspose.cells.b.a.b.zo(var12, var34 + var31 / 2.0F);
                  double var47 = 0.0D;
                  double var49 = 0.0D;
                  float var51 = 0.0F;
                  float var52 = 0.0F;
                  if (var45 != null) {
                     switch(var45.g()) {
                     case 0:
                        double var53 = var45.e().size() > var29 ? var45.a(var45.e().get(var29)) : 0.0D;
                        var47 = var53;
                        var53 = var45.f().size() > var29 ? var45.a(var45.f().get(var29)) : 0.0D;
                        var49 = var53;
                        break;
                     case 1:
                        var47 = var45.c();
                        var49 = var47;
                        break;
                     case 2:
                        var47 = var45.c() * var36 / 100.0D;
                        var49 = -var47;
                     }

                     var49 = var49 * 100.0D / var40;
                     var47 = var47 * 100.0D / var40;
                     var51 = (float)var47 / (float)(var9.z() - var9.D()) * (float)var3.e();
                     var52 = (float)var49 / (float)(var9.z() - var9.D()) * (float)var3.e();
                     if (!var9.p()) {
                        if (var36 <= 0.0D) {
                           var46.a(var46.d() - var60);
                        } else {
                           var46.a(var46.d() + var60);
                        }
                     } else if (var36 <= 0.0D) {
                        var46.a(var46.d() + var60);
                     } else {
                        var46.a(var46.d() - var60);
                     }
                  }

                  var45.a(var46, var51, var52);
                  if (!var9.p()) {
                     if (var36 >= 0.0D) {
                        var60 = var12 + var60 - var59;
                     } else {
                        var60 = var12 - var60;
                     }
                  } else if (var36 >= 0.0D) {
                     var60 = var12 - var60;
                  } else {
                     var60 = var12 + var60 - var59;
                  }

                  com.aspose.cells.b.a.b.zq var62 = new com.aspose.cells.b.a.b.zq(var60, var34, var59, var31);
                  com.aspose.cells.b.a.b.zq var54 = new com.aspose.cells.b.a.b.zq(var62.f(), var62.g(), var62.h(), var62.i());
                  if (var62.f() < (float)var3.c()) {
                     var62.c(var62.h() - ((float)var3.c() - var62.f()));
                     var62.a((float)var3.c());
                  }

                  if (var62.l() > (float)(var3.i() + 1)) {
                     var62.c(var62.h() - (var62.l() - (float)var3.i()));
                  }

                  if (var62.m() >= (float)var3.d() && var62.g() <= (float)var3.j()) {
                     if (var62.g() < (float)var3.d()) {
                        var62.d(var62.i() - ((float)var3.d() - var62.g()));
                        var62.b((float)var3.d());
                     } else if (var62.m() > (float)var3.j()) {
                        var62.d(var62.i() - (var62.m() - (float)var3.j()));
                     }

                     if (var62.i() + 1.0F >= (var31 - 1.0F) / 3.0F) {
                        if (!var61) {
                           a(var0, var30, var62, var1.g(var2.aw()).a(var26), var12, var9);
                        }

                        Object[] var55 = new Object[4];
                        boolean var56;
                        if (var54.f() + var54.h() / 2.0F < var12) {
                           var56 = false;
                        } else if (var36 != 0.0D) {
                           var56 = true;
                        } else if (var9.p()) {
                           var56 = false;
                        } else {
                           var56 = true;
                        }

                        var55[0] = var26;
                        var55[1] = var29;
                        var55[2] = var54;
                        var55[3] = var56;
                        if (!var30.a()) {
                           com.aspose.cells.b.a.a.ze.a(var19, (Object)var55);
                        }

                        if (var2.X()) {
                           com.aspose.cells.b.a.a.ze.a(var35, (Object)var62);
                           com.aspose.cells.b.a.a.ze.a(var35, (Object)var56);
                        }
                     }
                  }
               }

               ArrayList[] var58 = new ArrayList[]{var27};
               a(var0, var2, var58, var35);
               var27 = var58[0];
            }

            return var19;
         }
      }
   }

   private static ArrayList b(zn var0, zif var1, zbcp var2, com.aspose.cells.b.a.b.zp var3, float var4) throws Exception {
      int var5 = var2.af();
      byte var6 = 8;
      zbcr var7 = var1.z();
      int var8 = var7.getCount();
      zbo var9;
      int var10;
      zbo var11;
      ArrayList var12;
      if (var5 == 1) {
         var11 = var1.e();
         var9 = var1.E();
         var10 = var7.b(1, var6);
         var12 = zhz.a((List)var1.z().c(), var1.S());
      } else {
         var11 = var1.g();
         var9 = var1.G();
         var10 = var7.b(2, var6);
         var12 = zhz.a((List)var1.z().d(), var1.S());
      }

      double var13 = var9.D();
      double var15 = var9.z();
      float var17 = (float)var2.K() / 100.0F;
      float var18 = (float)var2.J() / 100.0F;
      ArrayList var19 = new ArrayList();
      int var20 = var12.size();
      int var21 = var11.j();
      int var22 = (int)var11.D();
      int var23 = (int)var11.z();
      boolean var24 = false;
      int var62;
      if (!var11.f() && !var1.u()) {
         var62 = zbq.a(var21, var23, var22, var1.S());
         if (var62 == 0) {
            var62 = 1;
         }
      } else {
         var62 = zbq.a(var21, var23, var22, var1.S()) + 1;
      }

      double var25 = (double)var3.f() / (double)var62;
      ArrayList var27 = new ArrayList();

      for(int var28 = 0; var28 < var20; ++var28) {
         zjd var29 = var2.D().b(var28);
         float var30 = (float)(var25 / (double)((float)var10 - var17 * (float)(var10 - 1) + var18));
         float var31 = var30 * var17;
         float var32 = var30 * var18;
         int var33 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var12.get(var28)));
         var33 = zbq.a(var21, var33, var1.S());
         int var34 = zbq.a(var21, var33, var22, var1.S());
         float var35 = (float)(var25 * (double)var34);
         if (!var11.f() && !var1.u()) {
            var35 -= (float)(var25 / 2.0D);
         }

         float var36 = 0.0F;
         if (var11.p()) {
            var36 = (float)var3.d() + var35 + var32 / 2.0F;
         } else {
            var36 = (float)(var3.d() + var3.f()) - var30 - var35 - var32 / 2.0F;
         }

         List var37 = var7.a(var5, new int[]{var6});
         int var38 = var7.a(var2, var5, new int[]{var6});
         if (var38 == -1) {
            return var19;
         }

         int var39 = var2.ai();
         if (var11.p()) {
            var36 += (float)var38 * (var30 - var31);
         } else {
            var36 -= (float)var38 * (var30 - var31);
         }

         ArrayList var40 = new ArrayList();
         if (var29 != null) {
            double var41 = var29.v();
            double var43 = var41;
            double var45 = 0.0D;
            int var47;
            zjd var48;
            double var49;
            if (var41 >= 0.0D) {
               for(var47 = 0; var47 < var38; ++var47) {
                  var48 = ((zbcp)var37.get(var47)).D().b(var28);
                  if (var48 != null) {
                     var49 = var48.v();
                     if (var49 > 0.0D) {
                        var43 += var49;
                     }
                  }
               }
            } else {
               for(var47 = 0; var47 < var38; ++var47) {
                  var48 = ((zbcp)var37.get(var47)).D().b(var28);
                  if (var48 != null) {
                     var49 = var48.v();
                     if (var49 <= 0.0D) {
                        var43 += var49;
                     }
                  }
               }
            }

            for(var47 = 0; var47 < var37.size(); ++var47) {
               var48 = ((zbcp)var37.get(var47)).D().b(var28);
               if (var48 != null) {
                  var49 = var48.v();
                  var45 += Math.abs(var49);
               }
            }

            float var64 = 0.0F;
            float var65 = 0.0F;
            if (var45 != 0.0D) {
               var64 = (float)(Math.abs(var41) * 100.0D / var45 / (var9.z() - var9.D()) * (double)var3.e());
               var65 = (float)(Math.abs(var43) * 100.0D / var45 / (var9.z() - var9.D()) * (double)var3.e());
            }

            boolean var66 = false;
            if (var64 == 0.0F) {
               var66 = true;
            }

            zsp var50 = var2.x();
            com.aspose.cells.b.a.b.zo var51 = new com.aspose.cells.b.a.b.zo(var4, var36 + var30 / 2.0F);
            double var52 = 0.0D;
            double var54 = 0.0D;
            float var56 = 0.0F;
            float var57 = 0.0F;
            if (var50 != null) {
               switch(var50.g()) {
               case 0:
                  double var58 = var50.e().size() > var28 ? var50.a(var50.e().get(var28)) : 0.0D;
                  var52 = var58;
                  var58 = var50.f().size() > var28 ? var50.a(var50.f().get(var28)) : 0.0D;
                  var54 = var58;
                  break;
               case 1:
                  var52 = var50.c();
                  var54 = var52;
                  break;
               case 2:
                  var52 = var50.c() * var41 / 100.0D;
                  var54 = -var52;
               }

               var54 = var54 * 100.0D / var45;
               var52 = var52 * 100.0D / var45;
               var56 = (float)var52 / (float)(var9.z() - var9.D()) * (float)var3.e();
               var57 = (float)var54 / (float)(var9.z() - var9.D()) * (float)var3.e();
               if (!var9.p()) {
                  if (var41 <= 0.0D) {
                     var51.a(var51.d() - var65);
                  } else {
                     var51.a(var51.d() + var65);
                  }
               } else if (var41 <= 0.0D) {
                  var51.a(var51.d() + var65);
               } else {
                  var51.a(var51.d() - var65);
               }
            }

            var50.a(var51, var56, var57);
            if (!var9.p()) {
               if (var41 >= 0.0D) {
                  var65 = var4 + var65 - var64;
               } else {
                  var65 = var4 - var65;
               }
            } else if (var41 >= 0.0D) {
               var65 = var4 - var65;
            } else {
               var65 = var4 + var65 - var64;
            }

            com.aspose.cells.b.a.b.zq var67 = new com.aspose.cells.b.a.b.zq(var65, var36, var64, var30);
            com.aspose.cells.b.a.b.zq var59 = new com.aspose.cells.b.a.b.zq(var67.f(), var67.g(), var67.h(), var67.i());
            if (var67.g() < (float)var3.d()) {
               var67.d(var67.i() - ((float)var3.d() - var67.g()));
               var67.b((float)var3.d());
            }

            if (var67.m() > (float)(var3.j() + 1)) {
               var67.d(var67.i() - (var67.m() - (float)var3.j()));
            }

            if (var67.l() >= (float)var3.c() && var67.j() <= (float)var3.i()) {
               if (var67.f() < (float)var3.c()) {
                  var67.c(var67.h() - ((float)var3.c() - var67.f()));
                  var67.a((float)var3.c());
               } else if (var67.l() > (float)var3.i()) {
                  var67.c(var67.h() - (var67.l() - (float)var3.i()));
               }

               if (var67.i() + 1.0F >= (var30 - 1.0F) / 3.0F) {
                  if (!var66) {
                     a(var0, var29, var67, var1.g(var2.aw()).a(var39), var4, var9);
                  }

                  Object[] var60 = new Object[4];
                  boolean var61;
                  if (var59.f() + var59.h() / 2.0F < var4) {
                     var61 = false;
                  } else if (var41 != 0.0D) {
                     var61 = true;
                  } else if (var9.p()) {
                     var61 = false;
                  } else {
                     var61 = true;
                  }

                  var60[0] = var39;
                  var60[1] = var28;
                  var60[2] = var59;
                  var60[3] = var61;
                  if (!var29.a()) {
                     com.aspose.cells.b.a.a.ze.a(var19, (Object)var60);
                  }

                  if (var2.X()) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var67);
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var61);
                  }
               }
            }
         }

         ArrayList[] var63 = new ArrayList[]{var27};
         a(var0, var2, var63, var40);
         var27 = var63[0];
      }

      return var19;
   }

   static void a(zn var0, zif var1, float var2, double var3, int var5) throws Exception {
      zbcr var6 = var1.z();
      int var7 = var6.getCount();
      zbo var8 = var1.E();
      zbo var9 = var1.e();
      if (var9.k() == 2) {
         a(var0, var1, var2, var3);
      } else {
         ArrayList var10 = new ArrayList();
         float var11 = var1.N().i() / (float)var5;
         float var12 = var1.N().a(true, var5, var7);
         float var13 = var1.N().k();
         float var14 = var12 * (float)var1.o() / 100.0F;

         for(int var15 = 0; var15 < var5; ++var15) {
            ArrayList var16 = var6.j();

            for(int var17 = 0; var17 < var16.size(); ++var17) {
               zbcp var18 = (zbcp)var16.get(var17);
               int var19 = var18.ai();
               float var20 = (float)var17 * var12;
               float var21 = var11 * (float)var15 + var14 / 2.0F + var20;
               var21 = var1.N().f() - var21;
               zjf var22 = var18.D();
               int var23 = var15;
               if (var9.p()) {
                  var23 = var5 - 1 - var15;
               }

               zjd var24 = var22.b(var23);
               if (var24 != null && !var24.a() && !var24.H()) {
                  double var25 = var8.g(var24.v());
                  float var27 = (float)((var25 - var3) / (var8.z() - var8.D()) * (double)var1.N().g());
                  if (var8.p()) {
                     var27 = -var27;
                  }

                  a(var0, var24, var1, var21, var12, var13, var2, var27, Double.NaN);
                  com.aspose.cells.b.a.b.zo var28 = a(var1, var21, var12, var13, var2, var27);
                  Object[] var29 = new Object[]{var19, var23, var28};
                  com.aspose.cells.b.a.a.ze.a(var10, (Object)var29);
               }
            }
         }

         a(var0, var1, var10);
      }
   }

   private static void a(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      zbvc var6 = var1.N();
      int var7 = var5.getCount();
      zbo var8 = var1.E();
      zbo var9 = var1.e();
      ArrayList var10 = new ArrayList();
      int var11 = (int)var9.z();
      int var12 = (int)var9.D();
      int var13 = var9.j();
      int var14 = zbq.a(var13, var11, var12, var1.S()) + 1;
      float var15 = var6.i() / (float)var14;
      float var16 = var1.N().a(true, var14, var7);
      float var17 = var1.N().k();
      float var18 = var16 * (float)var1.o() / 100.0F;
      ArrayList var19 = zhz.a((List)var1.z().c(), var1.S());
      int var20 = var19.size();

      for(int var21 = 0; var21 < var20; ++var21) {
         int var22 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var19.get(var21)));
         var22 = zbq.a(var13, var22, var1.S());
         int var23 = zbq.a(var13, var22, (int)var9.D(), var1.S());
         float var24 = var15 * (float)var23;
         float var25 = var24 + var18 / 2.0F;
         var25 = var1.N().f() - var25 + var16;
         ArrayList var26 = var5.j();

         for(int var27 = 0; var27 < var26.size(); ++var27) {
            zbcp var28 = (zbcp)var26.get(var27);
            int var29 = var28.ai();
            var25 -= var16;
            zjf var31 = var28.D();
            int var32 = var21;
            if (var9.p()) {
               var32 = var20 - 1 - var21;
            }

            zjd var33 = var31.b(var32);
            if (var33 != null && !var33.a() && !var33.H()) {
               double var34 = var8.g(var33.v());
               float var36 = (float)((var34 - var3) / (var8.z() - var8.D()) * (double)var1.N().g());
               if (var8.p()) {
                  var36 = -var36;
               }

               a(var0, var33, var1, var25, var16, var17, var2, var36, Double.NaN);
               com.aspose.cells.b.a.b.zo var37 = a(var1, var25, var16, var17, var2, var36);
               Object[] var38 = new Object[]{var29, var32, var37};
               com.aspose.cells.b.a.a.ze.a(var10, (Object)var38);
            }
         }
      }

      a(var0, var1, var10);
   }

   static void a(zn var0, zif var1, double var2, int var4) throws Exception {
      zbcr var5 = var1.z();
      zbo var6 = var1.E();
      zbo var7 = var1.e();
      float var8 = 0.0F;
      if (var1.E().p()) {
         var8 = var1.N().e() + (float)Math.abs(var6.z() / (double)((float)(var6.z() - var6.D()))) * var1.N().g();
      } else {
         var8 = var1.N().e() + (float)Math.abs(var6.D() / (double)((float)(var6.z() - var6.D()))) * var1.N().g();
      }

      if (var7.k() == 2) {
         b(var0, var1, var8, var2);
      } else {
         ArrayList var9 = new ArrayList();
         float var10 = var1.N().i() / (float)var4;
         float var11 = var1.N().a(true, var4, 1);
         float var12 = var1.N().k();
         float var13 = var11 * (float)var1.o() / 100.0F;

         for(int var14 = 0; var14 < var4; ++var14) {
            ArrayList var15 = new ArrayList();
            ArrayList var16 = var5.j();

            int var17;
            for(var17 = 0; var17 < var16.size(); ++var17) {
               zbcp var18 = (zbcp)var16.get(var17);
               int var19 = var18.ai();
               float var20 = var10 * (float)var14 + var13 / 2.0F;
               var20 = var1.N().f() - var20;
               zjf var21 = var18.D();
               int var22 = var14;
               if (var7.p()) {
                  var22 = var4 - 1 - var14;
               }

               zjd var23 = var21.b(var22);
               if (var23 != null && !var23.a() && !var23.H()) {
                  double var25 = var23.v();
                  double var27 = 0.0D;
                  double[] var29 = new double[]{var25};
                  double[] var30 = new double[]{var27};
                  boolean var31 = zjl.a(var29, var30, var16, var17, var22, var6.z(), var6.D());
                  var25 = var29[0];
                  var27 = var30[0];
                  if (var31) {
                     float var32 = (float)(var25 / (var6.z() - var6.D()) * (double)var1.N().g());
                     float var33 = (float)(var27 / (var6.z() - var6.D()) * (double)var1.N().g());
                     float var34;
                     if (var6.p()) {
                        var34 = var8 - (var33 - var32);
                        var32 = -var32;
                     } else {
                        var34 = var8 + (var33 - var32);
                     }

                     float var35 = var34 + var32;
                     if (var34 < var1.N().e()) {
                        var34 = var1.N().e();
                     }

                     if (var34 > var1.N().e() + var1.N().g()) {
                        var34 = var1.N().e() + var1.N().g();
                     }

                     if (var35 < var1.N().e()) {
                        var35 = var1.N().e();
                     }

                     if (var35 > var1.N().e() + var1.N().g()) {
                        var35 = var1.N().e() + var1.N().g();
                     }

                     var32 = var35 - var34;
                     Object[] var36 = new Object[]{var23, var20, var34, var32, var27};
                     a(var25, var36, var15, var6);
                     com.aspose.cells.b.a.b.zo var37 = b(var1, var20, var11, var12, var34, var32);
                     Object[] var38 = new Object[]{var19, var22, var37};
                     com.aspose.cells.b.a.a.ze.a(var9, (Object)var38);
                  }
               }
            }

            for(var17 = 0; var17 < var15.size(); ++var17) {
               Object[] var39 = (Object[])((Object[])var15.get(var17));
               zjd var40 = (zjd)var39[0];
               a(var0, var40, var1, (Float)var39[1], var11, var12, (Float)var39[2], (Float)var39[3], (Double)var39[4]);
            }

            var15.clear();
         }

         a(var0, var1, var9);
      }
   }

   private static void b(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      int var6 = var5.getCount();
      zbo var7 = var1.E();
      zbo var8 = var1.e();
      ArrayList var9 = new ArrayList();
      int var10 = (int)var8.z();
      int var11 = (int)var8.D();
      int var12 = var8.j();
      int var13 = zbq.a(var12, var10, var11, var1.S()) + 1;
      float var14 = var1.N().i() / (float)var13;
      float var15 = var1.N().a(true, var13, 1);
      float var16 = var1.N().k();
      float var17 = var15 * (float)var1.o() / 100.0F;
      ArrayList var18 = zhz.a((List)var1.z().c(), var1.S());
      int var19 = var18.size();

      for(int var20 = 0; var20 < var19; ++var20) {
         ArrayList var21 = new ArrayList();
         int var22 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var18.get(var20)));
         var22 = zbq.a(var12, var22, var1.S());
         int var23 = zbq.a(var12, var22, (int)var8.D(), var1.S());
         float var24 = var14 * (float)var23;
         float var25 = var24 + var17 / 2.0F;
         var25 = var1.N().f() - var25;
         ArrayList var26 = var5.j();

         int var27;
         for(var27 = 0; var27 < var26.size(); ++var27) {
            zbcp var28 = (zbcp)var26.get(var27);
            int var29 = var28.ai();
            zjf var30 = var28.D();
            int var31 = var20;
            if (var8.p()) {
               var31 = var19 - 1 - var20;
            }

            zjd var32 = var30.b(var31);
            if (var32 != null && !var32.a() && !var32.H()) {
               double var34 = var32.v();
               double var36 = 0.0D;
               double[] var38 = new double[]{var34};
               double[] var39 = new double[]{var36};
               boolean var40 = zjl.a(var38, var39, var26, var27, var31, var7.z(), var7.D());
               var34 = var38[0];
               var36 = var39[0];
               if (var40) {
                  float var41 = (float)(var34 / (var7.z() - var7.D()) * (double)var1.N().g());
                  float var42 = (float)(var36 / (var7.z() - var7.D()) * (double)var1.N().g());
                  float var43;
                  if (var7.p()) {
                     var43 = var2 - (var42 - var41);
                     var41 = -var41;
                  } else {
                     var43 = var2 + (var42 - var41);
                  }

                  float var44 = var43 + var41;
                  if (var43 < var1.N().e()) {
                     var43 = var1.N().e();
                  }

                  if (var43 > var1.N().e() + var1.N().g()) {
                     var43 = var1.N().e() + var1.N().g();
                  }

                  if (var44 < var1.N().e()) {
                     var44 = var1.N().f();
                  }

                  if (var44 > var1.N().e() + var1.N().g()) {
                     var44 = var1.N().e() + var1.N().g();
                  }

                  var41 = var44 - var43;
                  Object[] var45 = new Object[]{var32, var25, var43, var41, var36};
                  a(var34, var45, var21, var7);
                  com.aspose.cells.b.a.b.zo var46 = b(var1, var25, var15, var16, var43, var41);
                  Object[] var47 = new Object[]{var29, var31, var46};
                  com.aspose.cells.b.a.a.ze.a(var9, (Object)var47);
               }
            }
         }

         for(var27 = 0; var27 < var21.size(); ++var27) {
            Object[] var48 = (Object[])((Object[])var21.get(var27));
            zjd var49 = (zjd)var48[0];
            a(var0, var49, var1, (Float)var48[1], var15, var16, (Float)var48[2], (Float)var48[3], (Double)var48[4]);
         }

         var21.clear();
      }

      a(var0, var1, var9);
   }

   static void b(zn var0, zif var1, double var2, int var4) throws Exception {
      zbcr var5 = var1.z();
      zbo var6 = var1.E();
      zbo var7 = var1.e();
      float var8 = 0.0F;
      if (var1.E().p()) {
         var8 = var1.N().e() + (float)Math.abs(var6.z() / (double)((float)(var6.z() - var6.D()))) * var1.N().g();
      } else {
         var8 = var1.N().e() + var1.N().g() - (float)Math.abs(var6.z() / (double)((float)(var6.z() - var6.D()))) * var1.N().g();
      }

      if (var7.k() == 2) {
         c(var0, var1, var8, var2);
      } else {
         ArrayList var9 = new ArrayList();
         float var10 = var1.N().i() / (float)var4;
         float var11 = var1.N().a(true, var4, 1);
         float var12 = var1.N().k();
         float var13 = var11 * (float)var1.o() / 100.0F;

         for(int var14 = 0; var14 < var4; ++var14) {
            ArrayList var15 = new ArrayList();
            ArrayList var16 = var5.j();

            int var17;
            for(var17 = 0; var17 < var16.size(); ++var17) {
               zbcp var18 = (zbcp)var16.get(var17);
               int var19 = var18.ai();
               float var20 = var10 * (float)var14 + var13 / 2.0F;
               var20 = var1.N().f() - var20;
               zjf var21 = var18.D();
               int var22 = var14;
               if (var7.p()) {
                  var22 = var4 - 1 - var14;
               }

               zjd var23 = var21.b(var22);
               if (var23 != null && !var23.a() && !var23.H()) {
                  double var25 = zjl.a(var16, var22);
                  if (var25 != 0.0D) {
                     double var27 = var23.v();
                     double[] var31 = new double[]{var27};
                     double[] var32 = new double[]{var27};
                     boolean var33 = zjl.a(var31, var32, var16, var17, var22, var6, var25);
                     var27 = var31[0];
                     double var29 = var32[0];
                     if (var33) {
                        float var34 = (float)(var27 * 100.0D / var25 / (var6.z() - var6.D()) * (double)var1.N().g());
                        float var35 = (float)(var29 * 100.0D / var25 / (var6.z() - var6.D()) * (double)var1.N().g());
                        float var36;
                        if (var6.p()) {
                           var36 = var8 - (var35 - var34);
                           var34 = -var34;
                        } else {
                           var36 = var8 + (var35 - var34);
                        }

                        float var37 = var36 + var34;
                        if (var36 < var1.N().e()) {
                           var36 = var1.N().e();
                        }

                        if (var36 > var1.N().e() + var1.N().g()) {
                           var36 = var1.N().e() + var1.N().g();
                        }

                        if (var37 < var1.N().e()) {
                           var37 = var1.N().e();
                        }

                        if (var37 > var1.N().e() + var1.N().g()) {
                           var37 = var1.N().e() + var1.N().g();
                        }

                        var34 = var37 - var36;
                        Object[] var38 = new Object[]{var23, var20, var36, var34, var29};
                        a(var27, var38, var15, var6);
                        com.aspose.cells.b.a.b.zo var39 = b(var1, var20, var11, var12, var36, var34);
                        Object[] var40 = new Object[]{var19, var22, var39};
                        com.aspose.cells.b.a.a.ze.a(var9, (Object)var40);
                     }
                  }
               }
            }

            for(var17 = 0; var17 < var15.size(); ++var17) {
               Object[] var41 = (Object[])((Object[])var15.get(var17));
               zjd var42 = (zjd)var41[0];
               a(var0, var42, var1, (Float)var41[1], var11, var12, (Float)var41[2], (Float)var41[3], (Double)var41[4]);
            }

            var15.clear();
         }

         a(var0, var1, var9);
      }
   }

   private static void c(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      zbo var6 = var1.E();
      zbo var7 = var1.e();
      ArrayList var8 = new ArrayList();
      int var9 = (int)var7.z();
      int var10 = (int)var7.D();
      int var11 = var7.j();
      int var12 = zbq.a(var11, var9, var10, var1.S()) + 1;
      float var13 = var1.N().i() / (float)var12;
      float var14 = var1.N().a(true, var12, 1);
      float var15 = var1.N().k();
      float var16 = var14 * (float)var1.o() / 100.0F;
      ArrayList var17 = zhz.a((List)var1.z().c(), var1.S());
      int var18 = var17.size();

      for(int var19 = 0; var19 < var18; ++var19) {
         ArrayList var20 = new ArrayList();
         int var21 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var17.get(var19)));
         var21 = zbq.a(var11, var21, var1.S());
         int var22 = zbq.a(var11, var21, (int)var7.D(), var1.S());
         float var23 = var13 * (float)var22;
         float var24 = var23 + var16 / 2.0F;
         var24 = var1.N().f() - var24;
         ArrayList var25 = var5.j();

         int var26;
         for(var26 = 0; var26 < var25.size(); ++var26) {
            zbcp var27 = (zbcp)var25.get(var26);
            int var28 = var27.ai();
            zjf var29 = var27.D();
            int var30 = var19;
            if (var7.p()) {
               var30 = var18 - 1 - var19;
            }

            zjd var31 = var29.b(var30);
            if (var31 != null && !var31.a() && !var31.H()) {
               double var33 = zjl.a(var25, var30);
               if (var33 != 0.0D) {
                  double var35 = var31.v();
                  double[] var39 = new double[]{var35};
                  double[] var40 = new double[]{var35};
                  boolean var41 = zjl.a(var39, var40, var25, var26, var30, var6, var33);
                  var35 = var39[0];
                  double var37 = var40[0];
                  if (var41) {
                     float var42 = (float)(var35 * 100.0D / var33 / (var6.z() - var6.D()) * (double)var1.N().g());
                     float var43 = (float)(var37 * 100.0D / var33 / (var6.z() - var6.D()) * (double)var1.N().g());
                     float var44;
                     if (var6.p()) {
                        var44 = var2 - (var43 - var42);
                        var42 = -var42;
                     } else {
                        var44 = var2 + (var43 - var42);
                     }

                     float var45 = var44 + var42;
                     if (var44 < var1.N().e()) {
                        var44 = var1.N().e();
                     }

                     if (var44 > var1.N().e() + var1.N().g()) {
                        var44 = var1.N().e() + var1.N().g();
                     }

                     if (var45 < var1.N().e()) {
                        var45 = var1.N().f();
                     }

                     if (var45 > var1.N().e() + var1.N().g()) {
                        var45 = var1.N().e() + var1.N().g();
                     }

                     var42 = var45 - var44;
                     Object[] var46 = new Object[]{var31, var24, var44, var42, var37};
                     a(var35, var46, var20, var6);
                     com.aspose.cells.b.a.b.zo var47 = b(var1, var24, var14, var15, var44, var42);
                     Object[] var48 = new Object[]{var28, var30, var47};
                     com.aspose.cells.b.a.a.ze.a(var8, (Object)var48);
                  }
               }
            }
         }

         for(var26 = 0; var26 < var20.size(); ++var26) {
            Object[] var49 = (Object[])((Object[])var20.get(var26));
            zjd var50 = (zjd)var49[0];
            a(var0, var50, var1, (Float)var49[1], var14, var15, (Float)var49[2], (Float)var49[3], (Double)var49[4]);
         }

         var20.clear();
      }

      a(var0, var1, var8);
   }

   private static void a(double var0, Object[] var2, ArrayList var3, zbo var4) {
      zif var5 = var4.c();
      float var6 = (Float)var2[2] + (Float)var2[3];
      if (var3.size() == 0) {
         com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
      } else {
         for(int var7 = 0; var7 < var3.size(); ++var7) {
            Object[] var8 = (Object[])((Object[])var3.get(var7));
            float var9 = (Float)var8[2] + (Float)var8[3];
            if (var6 < var9) {
               var3.add(var7, var2);
               break;
            }

            if (var6 == var9) {
               if (var4.p()) {
                  if (var0 >= 0.0D) {
                     var3.add(var7, var2);
                  } else {
                     var3.add(var7 + 1, var2);
                  }
               } else if (var0 < 0.0D) {
                  var3.add(var7, var2);
               } else {
                  var3.add(var7 + 1, var2);
               }
               break;
            }

            if (var7 == var3.size() - 1) {
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
               break;
            }
         }
      }

   }

   private static com.aspose.cells.b.a.b.zo a(zif var0, float var1, float var2, float var3, float var4, float var5) {
      float var7 = var4 + var5;
      float var9 = var0.N().j();
      com.aspose.cells.b.a.b.zo var6;
      float var8;
      byte var10;
      if (var7 <= var9) {
         var8 = 2.0F * (var9 - var7);
         if (var4 > var7) {
            var10 = 0;
         } else {
            var10 = 3;
         }

         var6 = zkq.a(var0, var1, var8, var3, var10);
      } else {
         if (var4 > var7) {
            var10 = 1;
         } else {
            var10 = 2;
         }

         var8 = 2.0F * (var7 - var9);
         var6 = zkq.a(var0, var1, var8, var3, var10);
      }

      com.aspose.cells.b.a.b.zo var11 = zkq.a(var0, var1, 1.0F, var3, 0);
      float var12 = var3 * (float)Math.sin((double)var0.p() * 3.141592653589793D / 180.0D);
      return new com.aspose.cells.b.a.b.zo(var6.d(), var11.e() - (var2 + var12) / 2.0F);
   }

   private static com.aspose.cells.b.a.b.zo b(zif var0, float var1, float var2, float var3, float var4, float var5) {
      var4 += var5 / 2.0F;
      float var7 = var0.N().j();
      float var6;
      if (var4 <= var7) {
         var6 = 2.0F * (var7 - var4);
         return zkq.a(var0, var1 - var2 / 2.0F, var6, var3, 0);
      } else {
         var6 = 2.0F * (var4 - var7);
         return zkq.a(var0, var1 - var2 / 2.0F, var6, var3, 1);
      }
   }

   private static void a(zn var0, zif var1, ArrayList var2) throws Exception {
      zbcr var3 = var1.z();

      for(int var4 = 0; var4 < var2.size(); ++var4) {
         Object[] var5 = (Object[])((Object[])var2.get(var4));
         int var6 = (Integer)var5[0];
         int var7 = (Integer)var5[1];
         com.aspose.cells.b.a.b.zo var8 = (com.aspose.cells.b.a.b.zo)var5[2];
         zpt var9 = var3.c(var6).w();
         com.aspose.cells.b.a.b.zt var10 = zpv.a(var0, var1.e(), var3, var6, var7, (int)var1.N().g());
         com.aspose.cells.b.a.b.zq var11 = new com.aspose.cells.b.a.b.zq(var8.d() - var10.b() / 2.0F, var8.e() - var10.c() / 2.0F, var10.b(), var10.c());
         var9.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var11.f()), zbuk.c((double)var11.g()), zbuk.a((double)var11.h()), zbuk.a((double)var11.i()));
         var9.a().z();
         zpv.a(var0, var1.e(), var3, var6, var7, var11);
      }

   }

   private static void a(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, double var8) {
      zbcp var10 = var1.g().a();
      double var11 = 1.0D;
      double var13 = 1.0D;
      double var15;
      double var17;
      double[] var19;
      double[] var20;
      switch(var10.G()) {
      case 0:
         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var11, (float)var13);
         break;
      case 1:
         if (!var10.an() && !var10.ap()) {
            var11 = 0.0D;
         } else {
            var15 = 0.0D;
            var17 = 0.0D;
            var19 = new double[]{var15};
            var20 = new double[]{var17};
            zkq.a(var10.ah(), var1.G(), var19, var20);
            var15 = var19[0];
            var17 = var20[0];
            if (var1.v() > 0.0D) {
               var11 = var15 == 0.0D ? 1.0D : (var15 - var8) / var15;
               var13 = var15 == 0.0D ? 1.0D : (var15 - (var8 - var1.v())) / var15;
            } else {
               var11 = var17 == 0.0D ? 1.0D : (var17 - var8) / var17;
               var13 = var17 == 0.0D ? 1.0D : (var17 - (var8 - var1.v())) / var17;
            }
         }

         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var11, (float)var13);
         break;
      case 2:
         if (var10.an()) {
            var15 = 0.0D;
            var17 = 0.0D;
            var19 = new double[]{var15};
            var20 = new double[]{var17};
            zkq.b(var10.ah(), var1.G(), var19, var20);
            var15 = var19[0];
            var17 = var20[0];
            if (var1.v() > 0.0D) {
               var11 = var15 == 0.0D ? 1.0D : (var15 - var8) / var15;
               var13 = var15 == 0.0D ? 1.0D : (var15 - (var8 - var1.v())) / var15;
            } else {
               var11 = var17 == 0.0D ? 1.0D : (var17 - var8) / var17;
               var13 = var17 == 0.0D ? 1.0D : (var17 - (var8 - var1.v())) / var17;
            }
         } else if (var10.ap()) {
            var15 = 0.0D;
            var17 = 0.0D;
            var19 = new double[]{var15};
            var20 = new double[]{var17};
            zkq.a(var10.ah(), var1.G(), var19, var20);
            var15 = var19[0];
            var17 = var20[0];
            if (var1.v() > 0.0D) {
               var11 = var15 == 0.0D ? 1.0D : (var15 - var8) / var15;
               var13 = var15 == 0.0D ? 1.0D : (var15 - (var8 - var1.v())) / var15;
            } else {
               var11 = var17 == 0.0D ? 1.0D : (var17 - var8) / var17;
               var13 = var17 == 0.0D ? 1.0D : (var17 - (var8 - var1.v())) / var17;
            }
         } else {
            var11 = (double)((float)zkq.a(var1));
            var13 = 1.0D;
         }

         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var11, (float)var13);
         break;
      case 3:
         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var11, (float)var13);
         break;
      case 4:
         if (!var10.an() && !var10.ap()) {
            var11 = 0.0D;
         } else {
            var15 = 0.0D;
            var17 = 0.0D;
            var19 = new double[]{var15};
            var20 = new double[]{var17};
            zkq.a(var10.ah(), var1.G(), var19, var20);
            var15 = var19[0];
            var17 = var20[0];
            if (var1.v() > 0.0D) {
               var11 = var15 == 0.0D ? 1.0D : (var15 - var8) / var15;
               var13 = var15 == 0.0D ? 1.0D : (var15 - (var8 - var1.v())) / var15;
            } else {
               var11 = var17 == 0.0D ? 1.0D : (var17 - var8) / var17;
               var13 = var17 == 0.0D ? 1.0D : (var17 - (var8 - var1.v())) / var17;
            }
         }

         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var11, (float)var13);
         break;
      case 5:
         if (var10.an()) {
            var15 = 0.0D;
            var17 = 0.0D;
            var19 = new double[]{var15};
            var20 = new double[]{var17};
            zkq.b(var10.ah(), var1.G(), var19, var20);
            var15 = var19[0];
            var17 = var20[0];
            if (var1.v() > 0.0D) {
               var11 = var15 == 0.0D ? 1.0D : (var15 - var8) / var15;
               var13 = var15 == 0.0D ? 1.0D : (var15 - (var8 - var1.v())) / var15;
            } else {
               var11 = var17 == 0.0D ? 1.0D : (var17 - var8) / var17;
               var13 = var17 == 0.0D ? 1.0D : (var17 - (var8 - var1.v())) / var17;
            }
         } else if (var10.ap()) {
            var15 = 0.0D;
            var17 = 0.0D;
            var19 = new double[]{var15};
            var20 = new double[]{var17};
            zkq.a(var10.ah(), var1.G(), var19, var20);
            var15 = var19[0];
            var17 = var20[0];
            if (var1.v() > 0.0D) {
               var11 = var15 == 0.0D ? 1.0D : (var15 - var8) / var15;
               var13 = var15 == 0.0D ? 1.0D : (var15 - (var8 - var1.v())) / var15;
            } else {
               var11 = var17 == 0.0D ? 1.0D : (var17 - var8) / var17;
               var13 = var17 == 0.0D ? 1.0D : (var17 - (var8 - var1.v())) / var17;
            }
         } else {
            var11 = (double)((float)zkq.a(var1));
            var13 = 1.0D;
         }

         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var11, (float)var13);
      }

   }

   private static void a(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, float var8, float var9) {
      zas var10 = var1.i();
      com.aspose.cells.b.a.b.zo[] var11 = new com.aspose.cells.b.a.b.zo[8];
      zbuk.a(var11);
      float var13 = var2.N().j();
      float var14 = var6;
      byte var15 = 3;
      com.aspose.cells.b.a.b.zo var16 = com.aspose.cells.b.a.b.zo.a();
      float var17 = var5 * var9;
      float var18 = var4 * var9;
      float var19 = var3 - var4 * (1.0F - var9) / 2.0F;

      for(int var20 = 0; var20 < 2; ++var20) {
         float var12;
         if (var14 <= var13) {
            var12 = 2.0F * (var13 - var14);
            var11[var20] = zkq.a(var2, var19, var12, var17, 0);
            var11[var20 + 4].a(var11[var20].d());
            var11[var20 + 4].b(var11[var20].e() - var18);
            var11[var20 + var15] = zkq.a(var2, var19, var12, var17, 3);
            var11[var20 + var15 + 4].a(var11[var20 + var15].d());
            var11[var20 + var15 + 4].b(var11[var20 + var15].e() - var18);
         } else {
            var12 = 2.0F * (var14 - var13);
            var11[var20] = zkq.a(var2, var19, var12, var17, 1);
            var11[var20 + 4].a(var11[var20].d());
            var11[var20 + 4].b(var11[var20].e() - var18);
            var11[var20 + var15] = zkq.a(var2, var19, var12, var17, 2);
            var11[var20 + var15 + 4].a(var11[var20 + var15].d());
            var11[var20 + var15 + 4].b(var11[var20 + var15].e() - var18);
         }

         var15 = 1;
         var14 += var7;
         var19 = var3 - var4 * (1.0F - var8) / 2.0F;
         var17 = var5 * var8;
         var18 = var4 * var8;
      }

      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[0].d(), var11[0].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[1].d(), var11[1].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[2].d(), var11[2].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[3].d(), var11[3].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[4].d(), var11[4].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[5].d(), var11[5].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[6].d(), var11[6].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[7].d(), var11[7].e())));
      com.aspose.cells.b.a.b.zm var72 = zama.a(var1.k());

      try {
         com.aspose.cells.b.a.b.a.ze var21;
         com.aspose.cells.b.a.b.zc var22;
         if (var7 != 0.0F) {
            var21 = new com.aspose.cells.b.a.b.a.ze();
            var21.b(new com.aspose.cells.b.a.b.zo[]{var11[0], var11[1], var11[5], var11[4]});
            var22 = zax.a(var10, com.aspose.cells.a.c.zn.a(var21));

            try {
               var0.a(var22, var21);
            } finally {
               if (var22 != null) {
                  var22.f();
               }

            }

            com.aspose.cells.b.a.b.a.ze var23 = new com.aspose.cells.b.a.b.a.ze();
            var23.b(new com.aspose.cells.b.a.b.zo[]{var11[4], var11[5], var11[6], var11[7]});
            com.aspose.cells.b.a.b.zc var24 = zax.a(var10, com.aspose.cells.a.c.zn.a(var23), 0.6666667F);

            try {
               var0.a(var24, var23);
            } finally {
               if (var24 != null) {
                  var24.f();
               }

            }

            var0.a(var72, var21);
            var0.a(var72, var23);
         }

         if (var7 > 0.0F) {
            var21 = new com.aspose.cells.b.a.b.a.ze();
            var21.b(new com.aspose.cells.b.a.b.zo[]{var11[1], var11[2], var11[6], var11[5]});
            var22 = zax.a(var10, com.aspose.cells.a.c.zn.a(var21), 0.5F);

            try {
               var0.a(var22, var21);
            } finally {
               if (var22 != null) {
                  var22.f();
               }

            }

            var0.a(var72, var21);
         } else if (var7 < 0.0F) {
            var21 = new com.aspose.cells.b.a.b.a.ze();
            var21.b(new com.aspose.cells.b.a.b.zo[]{var11[0], var11[3], var11[7], var11[4]});
            var22 = zax.a(var10, com.aspose.cells.a.c.zn.a(var21), 0.0F);

            try {
               var0.a(var22, var21);
            } finally {
               if (var22 != null) {
                  var22.f();
               }

            }

            var0.a(var72, var21);
         } else {
            var21 = new com.aspose.cells.b.a.b.a.ze();
            var21.b(new com.aspose.cells.b.a.b.zo[]{var11[0], var11[3], var11[7], var11[4]});
            var22 = zax.a(var10, com.aspose.cells.a.c.zn.a(var21), 0.5F);

            try {
               var0.a(var22, var21);
            } finally {
               if (var22 != null) {
                  var22.f();
               }

            }

            var0.a(var72, var21);
         }
      } finally {
         if (var72 != null) {
            var72.r();
         }

      }

   }

   private static void b(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, float var8, float var9) {
      zas var10 = var1.i();
      float var11 = var6;
      float var13 = var2.N().j();
      HashMap var14 = new HashMap();
      HashMap var15 = new HashMap();
      float var16 = var3 - var4 / 2.0F;

      int var17;
      for(var17 = 0; var17 <= 90; ++var17) {
         double var18 = (double)var17 * 3.141592653589793D / 180.0D;
         float var20 = (float)((double)(var5 * var9) * Math.cos(var18));
         float var21 = (float)((double)var16 - (double)(var4 * var9 / 2.0F) * Math.sin(var18));
         float var22 = (float)((double)var16 + (double)(var4 * var9 / 2.0F) * Math.sin(var18));
         float var12;
         if (var11 <= var13) {
            var12 = 2.0F * (var13 - var11);
            if (!var14.containsKey(180 - var17)) {
               var14.put(180 - var17, zkq.a(var2, var21, var12, var20, 0));
            }

            if (!var14.containsKey(180 + var17)) {
               var14.put(180 + var17, zkq.a(var2, var22, var12, var20, 0));
            }

            if (!var14.containsKey(var17)) {
               var14.put(var17, zkq.a(var2, var21, var12, var20, 3));
            }

            if (!var14.containsKey(360 - var17)) {
               var14.put(360 - var17, zkq.a(var2, var22, var12, var20, 3));
            }
         } else {
            var12 = 2.0F * (var11 - var13);
            if (!var14.containsKey(180 - var17)) {
               var14.put(180 - var17, zkq.a(var2, var21, var12, var20, 1));
            }

            if (!var14.containsKey(180 + var17)) {
               var14.put(180 + var17, zkq.a(var2, var22, var12, var20, 1));
            }

            if (!var14.containsKey(var17)) {
               var14.put(var17, zkq.a(var2, var21, var12, var20, 2));
            }

            if (!var14.containsKey(360 - var17)) {
               var14.put(360 - var17, zkq.a(var2, var22, var12, var20, 2));
            }
         }

         float var23 = var11 + var7;
         float var24 = (float)((double)(var5 * var8) * Math.cos(var18));
         var21 = (float)((double)var16 - (double)(var4 * var8 / 2.0F) * Math.sin(var18));
         var22 = (float)((double)var16 + (double)(var4 * var8 / 2.0F) * Math.sin(var18));
         if (var23 <= var13) {
            var12 = 2.0F * (var13 - var23);
            if (!var15.containsKey(180 - var17)) {
               var15.put(180 - var17, zkq.a(var2, var21, var12, var24, 0));
            }

            if (!var15.containsKey(180 + var17)) {
               var15.put(180 + var17, zkq.a(var2, var22, var12, var24, 0));
            }

            if (!var15.containsKey(var17)) {
               var15.put(var17, zkq.a(var2, var21, var12, var24, 3));
            }

            if (!var15.containsKey(360 - var17)) {
               var15.put(360 - var17, zkq.a(var2, var22, var12, var24, 3));
            }
         } else {
            var12 = 2.0F * (var23 - var13);
            if (!var15.containsKey(180 - var17)) {
               var15.put(180 - var17, zkq.a(var2, var21, var12, var24, 1));
            }

            if (!var15.containsKey(180 + var17)) {
               var15.put(180 + var17, zkq.a(var2, var22, var12, var24, 1));
            }

            if (!var15.containsKey(var17)) {
               var15.put(var17, zkq.a(var2, var21, var12, var24, 2));
            }

            if (!var15.containsKey(360 - var17)) {
               var15.put(360 - var17, zkq.a(var2, var22, var12, var24, 2));
            }
         }
      }

      for(var17 = 0; var17 < 360; ++var17) {
         com.aspose.cells.b.a.a.ze.a(var1.c, var14.get(var17));
         com.aspose.cells.b.a.a.ze.a(var1.b, var15.get(var17));
      }

      com.aspose.cells.b.a.b.zo var86 = null;
      com.aspose.cells.b.a.b.zo var87 = null;
      byte var19 = 0;
      byte var89 = 0;
      com.aspose.cells.b.a.b.zo[] var91 = new com.aspose.cells.b.a.b.zo[]{var86};
      com.aspose.cells.b.a.b.zo[] var92 = new com.aspose.cells.b.a.b.zo[]{var87};
      int[] var93 = new int[]{var19};
      int[] var94 = new int[]{var89};
      a(var14, var91, var92, var93, var94);
      var86 = var91[0];
      var87 = var92[0];
      int var88 = var93[0];
      int var90 = var94[0];
      com.aspose.cells.b.a.b.zo var25 = null;
      com.aspose.cells.b.a.b.zo var26 = null;
      byte var27 = 0;
      byte var28 = 0;
      com.aspose.cells.b.a.b.zo[] var29 = new com.aspose.cells.b.a.b.zo[]{var25};
      com.aspose.cells.b.a.b.zo[] var30 = new com.aspose.cells.b.a.b.zo[]{var26};
      int[] var31 = new int[]{var27};
      int[] var32 = new int[]{var28};
      a(var15, var29, var30, var31, var32);
      var25 = var29[0];
      var26 = var30[0];
      int var95 = var31[0];
      int var96 = var32[0];
      int var36;
      if (var7 != 0.0F) {
         byte var33 = 90;
         short var34 = 270;
         float var35 = 0.5F;
         var36 = var2.p();
         float var37 = 7.5F;

         for(float var38 = (float)(var33 - var36); var38 <= (float)(var34 - var36); var38 += var37) {
            int var39 = (int)(var38 % 360.0F);
            com.aspose.cells.b.a.b.zo var40 = (com.aspose.cells.b.a.b.zo)var14.get(var39);
            com.aspose.cells.b.a.b.zo var41 = (com.aspose.cells.b.a.b.zo)var15.get(var39);
            if (var38 == (float)(var33 - var36)) {
               var40 = var87;
               var41 = var26;
            }

            float var42 = var37;
            if (var38 - (float)var33 == 30.0F && var36 <= 30 || var38 - (float)var33 == 75.0F || var38 - (float)var33 == 120.0F && var36 > 30) {
               var42 = 2.0F * var37;
            }

            if (var38 == (float)(var33 - var36) && (float)var36 % var37 != 0.0F) {
               var42 = (float)var36 % var37;
            }

            int var43 = var38 + var42 > (float)(var34 - var36) ? (var34 - var36) % 360 : (int)((var38 + var42) % 360.0F);
            com.aspose.cells.b.a.b.zo var44 = (com.aspose.cells.b.a.b.zo)var14.get(var43);
            com.aspose.cells.b.a.b.zo var45 = (com.aspose.cells.b.a.b.zo)var15.get(var43);
            if (var38 + var42 >= (float)(var34 - var36)) {
               var44 = var86;
               var45 = var25;
            }

            com.aspose.cells.b.a.b.a.ze var46 = new com.aspose.cells.b.a.b.a.ze();
            com.aspose.cells.b.a.b.zo[] var47 = new com.aspose.cells.b.a.b.zo[(int)var42 + 1];
            zbuk.a(var47);
            int var48 = 0;

            for(int var49 = (int)var38; var49 <= (int)var38 + (int)var42; ++var49) {
               var47[var48] = (com.aspose.cells.b.a.b.zo)var14.get(var49 % 360);
               ++var48;
            }

            var46.a(var40, var44);
            var46.a(var44, var45);
            com.aspose.cells.b.a.b.zo[] var103 = new com.aspose.cells.b.a.b.zo[(int)var42 + 1];
            zbuk.a(var103);
            var48 = 0;

            for(int var50 = (int)var38 + (int)var42; var50 >= (int)var38; --var50) {
               var103[var48] = (com.aspose.cells.b.a.b.zo)var15.get(var50 % 360);
               ++var48;
            }

            var46.a(var45, var41);
            var46.a(var41, var40);
            if (var36 >= 0 && var36 <= 30) {
               if (var38 - (float)var33 <= 30.0F) {
                  var35 = 0.9166667F + 0.5F * ((var38 - (float)var33) / 180.0F);
               } else {
                  var35 = 1.0833334F - 0.5F * ((var38 - (float)var33) / 180.0F);
               }
            } else if (var38 - (float)var33 <= 120.0F) {
               var35 = 0.6666666F + 0.5F * ((var38 - (float)var33) / 180.0F);
            } else {
               var35 = 1.3333334F - 0.5F * ((var38 - (float)var33) / 180.0F);
            }

            if (var35 == 1.0F) {
               var35 -= 0.011111111F;
            }

            com.aspose.cells.b.a.b.zc var104 = zax.a(var10, com.aspose.cells.a.c.zn.a(var46), var35);

            try {
               var0.a(var104, var46);
            } finally {
               if (var104 != null) {
                  var104.f();
               }

            }

            var38 += var42 - var37;
         }
      }

      com.aspose.cells.b.a.b.zm var97 = zama.a(var1.k());

      try {
         com.aspose.cells.b.a.b.zo[] var98 = new com.aspose.cells.b.a.b.zo[var14.size()];
         com.aspose.cells.b.a.b.zo[] var101 = new com.aspose.cells.b.a.b.zo[var15.size()];
         zbuk.a(var98);
         zbuk.a(var101);

         for(var36 = 0; var36 <= 360; ++var36) {
            var98[var36] = (com.aspose.cells.b.a.b.zo)var14.get(var36);
            var101[var36] = (com.aspose.cells.b.a.b.zo)var15.get(var36);
         }

         com.aspose.cells.b.a.b.a.ze var99 = new com.aspose.cells.b.a.b.a.ze();
         var99.c(var98);
         com.aspose.cells.b.a.b.a.ze var100 = new com.aspose.cells.b.a.b.a.ze();
         var100.c(var101);
         if (var2.D() != 0) {
            com.aspose.cells.b.a.b.zc var102;
            if (var7 > 0.0F) {
               var102 = zax.a(var10, com.aspose.cells.a.c.zn.a(var100), 0.7F);

               try {
                  var0.a(var102, var100);
               } finally {
                  if (var102 != null) {
                     var102.f();
                  }

               }

               var0.a(var97, var100);
               zkq.a(var0, var88, var90, var14, var97);
            } else if (var7 < 0.0F) {
               var102 = zax.a(var10, com.aspose.cells.a.c.zn.a(var100), 0.0F);

               try {
                  var0.a(var102, var99);
               } finally {
                  if (var102 != null) {
                     var102.f();
                  }

               }

               var0.a(var97, var99);
               zkq.a(var0, var88, var90, var15, var97);
            } else {
               var102 = zax.a(var10, com.aspose.cells.a.c.zn.a(var100), 0.7F);

               try {
                  var0.a(var102, var99);
               } finally {
                  if (var102 != null) {
                     var102.f();
                  }

               }

               var0.a(var97, var99);
            }
         } else {
            var0.b(var97, var87.d(), var87.e(), var86.d(), var86.e());
            var0.b(var97, var26.d(), var26.e(), var25.d(), var25.e());
         }

         if (var7 != 0.0F) {
            var0.b(var97, var87.d(), var87.e(), var26.d(), var26.e());
            var0.b(var97, var86.d(), var86.e(), var25.d(), var25.e());
         }
      } finally {
         if (var97 != null) {
            var97.r();
         }

      }

   }

   private static void a(HashMap var0, com.aspose.cells.b.a.b.zo[] var1, com.aspose.cells.b.a.b.zo[] var2, int[] var3, int[] var4) {
      var1[0] = com.aspose.cells.b.a.b.zo.a();
      var2[0] = com.aspose.cells.b.a.b.zo.a();
      var3[0] = 0;
      var4[0] = 0;
      com.aspose.cells.b.a.a.zc var5 = com.aspose.cells.b.a.a.zf.a(var0);

      while(true) {
         com.aspose.cells.b.a.b.zo var6;
         do {
            if (!var5.c()) {
               return;
            }

            var6 = (com.aspose.cells.b.a.b.zo)var5.b();
            if (com.aspose.cells.b.a.b.zo.a(var1[0], com.aspose.cells.b.a.b.zo.a()) || var6.e() > var1[0].e()) {
               var1[0] = var6;
               var3[0] = (Integer)var5.a();
            }
         } while(!com.aspose.cells.b.a.b.zo.a(var2[0], com.aspose.cells.b.a.b.zo.a()) && var6.e() >= var2[0].e());

         var2[0] = var6;
         var4[0] = (Integer)var5.a();
      }
   }
}
